﻿using UnityEngine;
using System.Collections;

public class mainGUI : MonoBehaviour {
	
	public int currentItemID;
	public Texture2D[] itemTexture;
	public string[] itemString={"Attack","Damage","Support","Rate","Armor","Evasion"};
	
	public int[] theValues;
	public GUIStyle highlightStyle;
	
	void Awake(){
		int N=6;
		currentItemID=0;
		itemTexture=new Texture2D[N];
		theValues=new int[N];
		for(int i=0;i<N;i++)
			theValues[i]=50;
		highlightStyle=new GUIStyle();
		highlightStyle.onNormal.textColor=Color.red;
	}
	
	void OnGUI(){
		int N=theValues.Length;
		//theValues[0]=ship.attack;
		//select the button
		for(int i=0;i<N;i++){
			if(i==currentItemID)
				GUI.Button(new Rect(110+100*i,110,80,80),itemString[i],highlightStyle);
			else
				if(GUI.Button(new Rect(110+100*i,110,80,80),itemString[i]))
					currentItemID=i;
		}
		GUI.Box(new Rect(100,200,600,400),itemString[currentItemID]);
		GUI.Box(new Rect(300,300,100,80),theValues[currentItemID].ToString());
		if(GUI.Button(new Rect(200,400,100,100),"+"))
			theValues[currentItemID]+=10;
		if(GUI.Button(new Rect(400,400,100,100),"-"))
			theValues[currentItemID]-=10;
		//ship.attack=theValues[0];
	}
}
